const express = require('express')
//拿post参数模块
const bodyParser = require('body-parser')
//跨域访问模块cors
const cors = require('cors')
const mongo = require('./config/db')
const routes = require('./router/index')
const app = new express()
mongo(app)
app.use(cors())
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended: false}))

routes(app)

app.listen(3000,() => {
    console.log('ok')
})
